package vip.ablog.xmall.coupon.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import vip.ablog.common.to.SkuReductionTo;
import vip.ablog.common.utils.PageUtils;
import vip.ablog.common.utils.Query;

import vip.ablog.xmall.coupon.dao.SkuFullReductionDao;
import vip.ablog.xmall.coupon.entity.SkuFullReductionEntity;
import vip.ablog.xmall.coupon.entity.SkuLadderEntity;
import vip.ablog.xmall.coupon.service.SkuFullReductionService;
import vip.ablog.xmall.coupon.service.SkuLadderService;

import javax.annotation.Resource;


@Service("skuFullReductionService")
public class SkuFullReductionServiceImpl extends ServiceImpl<SkuFullReductionDao, SkuFullReductionEntity> implements SkuFullReductionService {

    @Resource
    SkuLadderService skuLadderService;


    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<SkuFullReductionEntity> page = this.page(
                new Query<SkuFullReductionEntity>().getPage(params),
                new QueryWrapper<SkuFullReductionEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public void saveSkuReduction(SkuReductionTo skuReductionTo) {
        //5-4 sku的优惠、满减等信息；sms_sku_ladder\sms_sku_full_reduction\sms_xxxx
        SkuLadderEntity skuLadderEntity = new SkuLadderEntity();
        skuLadderEntity.setSkuId(skuReductionTo.getSkuId());
        //skuLadderService.save()
        //2
    }

}
